Computational task offloading for virtualized graphics

ABSTRACT

Methods, systems, and computer-readable media for computational task offloading for virtualized graphics are disclosed. A virtual GPU attached to a virtual compute instance is provisioned in a multi-tenant provider network. The virtual compute instance is implemented using a physical compute instance, and the virtual GPU is implemented using a physical GPU. Using a microcode compilation service, program code is compiled into microcode for a target GPU type associated with the virtual GPU. The microcode is executed on the virtual GPU.

BACKGROUND

Many companies and other organizations operate computer networks that interconnect numerous computing systems to support their operations, such as with the computing systems being co-located (e.g., as part of a local network) or instead located in multiple distinct geographical locations (e.g., connected via one or more private or public intermediate networks). For example, distributed systems housing significant numbers of interconnected computing systems have become commonplace. Such distributed systems may provide back-end services to servers that interact with clients. Such distributed systems may also include data centers that are operated by entities to provide computing resources to customers. Some data center operators provide network access, power, and secure installation facilities for hardware owned by various customers, while other data center operators provide “full service” facilities that also include hardware resources made available for use by their customers. As the scale and scope of distributed systems have increased, the tasks of provisioning, administering, and managing the resources have become increasingly complicated.

The advent of virtualization technologies for commodity hardware has provided benefits with respect to managing large-scale computing resources for many clients with diverse needs. For example, virtualization technologies may allow a single physical computing device to be shared among multiple users by providing each user with one or more virtual machines hosted by the single physical computing device. Each such virtual machine may be a software simulation acting as a distinct logical computing system that provides users with the illusion that they are the sole operators and administrators of a given hardware computing resource, while also providing application isolation and security among the various virtual machines. With virtualization, the single physical computing device can create, maintain, or delete virtual machines in a dynamic manner.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example system environment for virtualizing graphics processing in a provider network, according to one embodiment.

FIG. 2A illustrates further aspects of the example system environment for virtualizing graphics processing in a provider network, including selection of an instance type and virtual GPU class for a virtual compute instance with an attached virtual GPU, according to one embodiment.

FIG. 2B illustrates further aspects of the example system environment for virtualizing graphics processing in a provider network, including provisioning of a virtual compute instance with an attached virtual GPU, according to one embodiment.

FIG. 3 illustrates the use of a virtual compute instance with a virtual GPU to generate virtual GPU output for display on a client device, according to one embodiment.

FIG. 4 illustrates an example hardware architecture for implementing virtualized graphics processing, according to one embodiment.

FIG. 5 is a flowchart illustrating a method for virtualizing graphics processing in a provider network, according to one embodiment.

FIG. 6 illustrates an example system environment for computational task offloading for virtualized graphics processing, according to one embodiment.

FIG. 7 illustrates further aspects of the example system environment for computational task offloading for virtualized graphics processing, according to one embodiment.

FIG. 8A illustrates further aspects of the example system environment for computational task offloading for virtualized graphics processing, including modification of the computational offload service while maintaining the same graphics driver, according to one embodiment.

FIG. 8B illustrates further aspects of the example system environment for computational task offloading for virtualized graphics processing, including modification of the graphics driver while maintaining the same computational offload service, according to one embodiment.

FIG. 9 illustrates an example system environment for microcode compilation offloading for virtualized graphics processing, according to one embodiment.

FIG. 10 is a flowchart illustrating a method for providing computational task offloading for virtualized graphics processing, according to one embodiment.

FIG. 11 is a flowchart illustrating a method for providing microcode compilation offloading for virtualized graphics processing, according to one embodiment.

FIG. 12 illustrates an example computing device that may be used in some embodiments.

While embodiments are described herein by way of example for several embodiments and illustrative drawings, those skilled in the art will recognize that embodiments are not limited to the embodiments or drawings described. It should be understood, that the drawings and detailed description thereto are not intended to limit embodiments to the particular form disclosed, but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the spirit and scope as defined by the appended claims. The headings used herein are for organizational purposes only and are not meant to be used to limit the scope of the description or the claims. As used throughout this application, the word “may” is used in a permissive sense (i.e., meaning “having the potential to”), rather than the mandatory sense (i.e., meaning “must”). Similarly, the words “include,” “including,” and “includes” mean “including, but not limited to.”

DETAILED DESCRIPTION OF EMBODIMENTS

Various embodiments of methods, systems, and computer-readable media for computational task offloading for virtualized graphics are described. Using the techniques described herein, a virtual compute instance may be provisioned, and a virtual graphics processing unit (GPU) may be attached to the instance to provide virtualized graphics processing. The virtual compute instance may be configured to execute an application using the virtualized graphics processing provided by the virtual GPU. Computationally intensive tasks (e.g., compilation of shader programs into GPU microcode) that have typically been performed by a graphics driver of the virtual GPU may be offloaded from the graphics driver to a service. For example, a microcode compilation service may compile program code such as a shader program (e.g., a pixel shader or vertex shader) into microcode that is targeted to a particular GPU type. The compiled microcode may be provided by the service to a virtual GPU of the target type and then executed on the virtual GPU. The resulting microcode may be cached by the service, e.g., using a hash of the shader program and target GPU type. Microcode may be retrieved from the cache rather than compiled again if a request to compile the same shader for the same target GPU type is received. Other computational tasks, such as tessellation and/or path rendering, may be offloaded from the graphics driver to a service. By offloading computationally intensive tasks from a graphics server that implements the virtual GPU, the graphics server may be optimized for processing using the GPU and not for the CPU-intensive offloaded tasks. Additionally, the graphics driver and the service may be updated independently of one another.

Virtualized Graphics Processing in a Provider Network

FIG. 1 illustrates an example system environment for virtualizing graphics processing in a provider network, according to one embodiment. Clients of a provider network 100 may use computing devices such as client devices 180A-180N to access an elastic graphics service 110 and other resources offered by the provider network. The client devices 180A-180N may be coupled to the provider network 100 via one or more networks 190. The provider network 100 may provide compute virtualization 140 such that a plurality of virtual compute instances 141A-141Z may be implemented using a plurality of physical compute instances 142A-142N. The virtual compute instances 141A-141Z may also be referred to herein as virtual machines (VMs). Similarly, the provider network 100 may provide GPU virtualization 150 such that a plurality of virtual GPUs 151A-151Z may be implemented using a plurality of physical GPUs 152A-152N. An example hardware architecture for implementing virtual GPUs using physical GPUs is discussed with reference to FIG. 5. The underlying physical compute instances 142A-142N may be heterogeneous, and the underlying physical GPUs 152A-152N may be heterogeneous as well. In one embodiment, the compute virtualization 140 may use techniques for multi-tenancy to provision virtual compute instances 141A-141Z that exceed the physical compute instances 142A-142N in number. In one embodiment, the GPU virtualization 150 may use techniques for multi-tenancy to provision virtual GPUs 151A-151Z that exceed the physical GPUs 152A-152N in number.

The elastic graphics service 110 may offer, to clients, selection and provisioning of virtualized compute instances with attached virtualized GPUs. Accordingly, the elastic graphics service 110 may include an instance type selection functionality 120 and an instance provisioning functionality 130. In one embodiment, the provider network 100 may offer virtual compute instances 141A-141Z with varying computational and/or memory resources. In one embodiment, each of the virtual compute instances 141A-141Z may correspond to one of several instance types. An instance type may be characterized by its computational resources (e.g., number, type, and configuration of central processing units [CPUs] or CPU cores), memory resources (e.g., capacity, type, and configuration of local memory), storage resources (e.g., capacity, type, and configuration of locally accessible storage), network resources (e.g., characteristics of its network interface and/or network capabilities), and/or other suitable descriptive characteristics. Using the instance type selection functionality 120, an instance type may be selected for a client, e.g., based (at least in part) on input from the client. For example, a client may choose an instance type from a predefined set of instance types. As another example, a client may specify the desired resources of an instance type, and the instance type selection functionality 120 may select an instance type based on such a specification.

In one embodiment, the provider network 100 may offer virtual GPUs 151A-151Z with varying graphics processing capabilities. In one embodiment, each of the virtual GPUs 151A-151Z may correspond to one of several virtual GPU classes. A virtual GPU class may be characterized by its computational resources for graphics processing, memory resources for graphics processing, and/or other suitable descriptive characteristics. In one embodiment, the virtual GPU classes may represent subdivisions of graphics processing capabilities of a physical GPU, such as a full GPU, a half GPU, a quarter GPU, and so on. Using the instance type selection functionality 120, a virtual GPU class may be selected for a client, e.g., based (at least in part) on input from the client. For example, a client may choose a virtual GPU class from a predefined set of virtual GPU classes. As another example, a client may specify the desired resources of a virtual GPU class, and the instance type selection functionality 120 may select a virtual GPU class based on such a specification.

Therefore, using the instance type selection functionality 120, clients (e.g., using client devices 180A-180N) may specify requirements for virtual compute instances and virtual GPUs. The instance provisioning functionality 130 may provision virtual compute instances with attached virtual GPUs based on the specified requirements (including any specified instance types and virtual GPU classes). As used herein, provisioning a virtual compute instance generally includes reserving resources (e.g., computational and memory resources) of an underlying physical compute instance for the client (e.g., from a pool of available physical compute instances and other resources), installing or launching required software (e.g., an operating system), and making the virtual compute instance available to the client for performing tasks specified by the client. For a particular client, a virtual compute instance may be provisioned of the instance type selected by or for the client, and the virtual compute instance may be provisioned with an attached virtual GPU of the GPU class selected by or for the client. In one embodiment, a virtual GPU of substantially any virtual GPU class may be attached to a virtual compute instance of substantially any instance type.

The provider network 100 may be set up by an entity such as a company or a public sector organization to provide one or more services (such as various types of cloud-based computing or storage) accessible via the Internet and/or other networks to client devices 180A-180N. Provider network 100 may include numerous data centers hosting various resource pools, such as collections of physical and/or virtualized computer servers, storage devices, networking equipment and the like (e.g., implemented using computing system 3000 described below with regard to FIG. 12), needed to implement and distribute the infrastructure and services offered by the provider network 100. In some embodiments, provider network 100 may provide computing resources, such as compute virtualization service 140 and GPU virtualization service 150; storage services, such as a block-based storage service, key-value based data stores, or various types of database systems; and/or any other type of network-based services. Client devices 180A-180N may access these various services offered by provider network 100 via network(s) 190. Likewise, network-based services may themselves communicate and/or make use of one another to provide different services. For example, computing resources offered to client devices 180A-180N in units called “instances,” such as virtual or physical compute instances or storage instances, may make use of particular data volumes, providing virtual block storage for the compute instances. The provider network 100 may implement or provide a multi-tenant environment such that multiple clients (e.g., using client devices 180A-180N) may access or use a particular resource in a substantially simultaneous manner.

As noted above, compute virtualization service 140 may offer various virtual compute instances 141A-141Z to client devices 180A-180N. A virtual compute instance may, for example, comprise one or more servers with a specified computational capacity (which may be specified by indicating the type and number of CPUs, the main memory size, and so on) and a specified software stack (e.g., a particular version of an operating system, which may in turn run on top of a hypervisor). A number of different types of computing devices may be used singly or in combination to implement the compute instances of the compute virtualization service 140 in different embodiments, including general purpose or special purpose computer servers, storage devices, network devices and the like. In some embodiments, client devices 180A-180N or other any other user may be configured (and/or authorized) to direct network traffic to a virtual compute instance. In various embodiments, virtual compute instances 141A-141Z may attach or map to one or more data volumes provided by a storage service in order to obtain persistent storage for performing various operations. Using the techniques described herein, virtual GPUs 151A-151Z may be attached to virtual compute instances 141A-141Z to provide graphics processing for the virtual compute instances.

Virtual compute instances 141A-141Z may operate or implement a variety of different platforms, such as application server instances, Java™ virtual machines (JVMs) or other virtual machines, general purpose or special-purpose operating systems, platforms that support various interpreted or compiled programming languages such as Ruby, Perl, Python, C, C++ and the like, or high-performance computing platforms) suitable for performing client applications, without for example requiring the client devices 180A-180N to access an instance. In some embodiments, virtual compute instances 141A-141Z may have different instance types or configurations based on expected uptime ratios. The uptime ratio of a particular virtual compute instance may be defined as the ratio of the amount of time the instance is activated to the total amount of time for which the instance is reserved. Uptime ratios may also be referred to as utilizations in some implementations. If a client expects to use a compute instance for a relatively small fraction of the time for which the instance is reserved (e.g., 30%-35% of a year-long reservation), the client may decide to reserve the instance as a Low Uptime Ratio instance, and the client may pay a discounted hourly usage fee in accordance with the associated pricing policy. If the client expects to have a steady-state workload that requires an instance to be up most of the time, then the client may reserve a High Uptime Ratio instance and potentially pay an even lower hourly usage fee, although in some embodiments the hourly fee may be charged for the entire duration of the reservation, regardless of the actual number of hours of use, in accordance with pricing policy. An option for Medium Uptime Ratio instances, with a corresponding pricing policy, may be supported in some embodiments as well, where the upfront costs and the per-hour costs fall between the corresponding High Uptime Ratio and Low Uptime Ratio costs.

Virtual compute instance configurations may also include virtual compute instances with a general or specific purpose, such as computational workloads for compute intensive applications (e.g., high-traffic web applications, ad serving, batch processing, video encoding, distributed analytics, high-energy physics, genome analysis, and computational fluid dynamics), graphics intensive workloads (e.g., game streaming, 3D application streaming, server-side graphics workloads, rendering, financial modeling, and engineering design), memory intensive workloads (e.g., high performance databases, distributed memory caches, in-memory analytics, genome assembly and analysis), and storage optimized workloads (e.g., data warehousing and cluster file systems). In some embodiments, particular instance types for virtual compute instances may be associated with default classes for virtual GPUs. For example, some instance types may be configured without a virtual GPU as a default configuration, while other instance types designated for graphics intensive workloads may be designated with particular virtual GPU classes as a default configuration. Configurations of virtual compute instances may also include their location in a particular data center or availability zone, geographic location, and (in the case of reserved compute instances) reservation term length.

The client devices 180A-180N may represent or correspond to various clients or users of the provider network 100, such as customers who seek to use services offered by the provider network. The clients, users, or customers may represent persons, businesses, other organizations, and/or other entities. The client devices 180A-180N may be distributed over any suitable locations or regions. Each of the client devices 180A-180N may be implemented using one or more computing devices, any of which may be implemented by the example computing device 3000 illustrated in FIG. 12.

The client devices 180A-180N may encompass any type of client configurable to submit requests to provider network 100. For example, a given client device may include a suitable version of a web browser, or it may include a plug-in module or other type of code module configured to execute as an extension to or within an execution environment provided by a web browser. Alternatively, a client device may encompass an application such as a database application (or user interface thereof), a media application, an office application, or any other application that may make use of virtual compute instances, storage volumes, or other network-based services in provider network 100 to perform various operations. In some embodiments, such an application may include sufficient protocol support (e.g., for a suitable version of Hypertext Transfer Protocol [HTTP]) for generating and processing network-based service requests without necessarily implementing full browser support for all types of network-based data. In some embodiments, client devices 180A-180N may be configured to generate network-based service requests according to a Representational State Transfer (REST)-style network-based services architecture, a document- or message-based network-based services architecture, or another suitable network-based services architecture. In some embodiments, client devices 180A-180N (e.g., a computational client) may be configured to provide access to a virtual compute instance in a manner that is transparent to applications implement on the client device utilizing computational resources provided by the virtual compute instance. In at least some embodiments, client devices 180A-180N may provision, mount, and configure storage volumes implemented at storage services for file systems implemented at the client devices.

Client devices 180A-180N may convey network-based service requests to provider network 100 via external network(s) 190. In various embodiments, external network(s) 190 may encompass any suitable combination of networking hardware and protocols necessary to establish network-based communications between client devices 180A-180N and provider network 100. For example, the network(s) 190 may generally encompass the various telecommunications networks and service providers that collectively implement the Internet. The network(s) 190 may also include private networks such as local area networks (LANs) or wide area networks (WANs) as well as public or private wireless networks. For example, both a given client device and the provider network 100 may be respectively provisioned within enterprises having their own internal networks. In such an embodiment, the network(s) 190 may include the hardware (e.g., modems, routers, switches, load balancers, proxy servers, etc.) and software (e.g., protocol stacks, accounting software, firewall/security software, etc.) necessary to establish a networking link between the given client device and the Internet as well as between the Internet and the provider network 100. It is noted that in some embodiments, client devices 180A-180N may communicate with provider network 100 using a private network rather than the public Internet.

The provider network 100 may include a plurality of computing devices, any of which may be implemented by the example computing device 3000 illustrated in FIG. 12. In various embodiments, portions of the described functionality of the provider network 100 may be provided by the same computing device or by any suitable number of different computing devices. If any of the components of the provider network 100 are implemented using different computing devices, then the components and their respective computing devices may be communicatively coupled, e.g., via a network. Each of the illustrated components (such as the elastic graphics service 110 and its constituent functionalities 120 and 130) may represent any combination of software and hardware usable to perform their respective functions.

It is contemplated that the provider network 100 may include additional components not shown, fewer components than shown, or different combinations, configurations, or quantities of the components shown. For example, although physical compute instances 142A through 142N are shown for purposes of example and illustration, it is contemplated that different quantities and configurations of physical compute instances may be used. Similarly, although physical GPUs 152A through 152N are shown for purposes of example and illustration, it is contemplated that different quantities and configurations of physical GPUs may be used. Additionally, although three client devices 180A, 180B, and 180N are shown for purposes of example and illustration, it is contemplated that different quantities and configurations of client devices may be used. Aspects of the functionality described herein for providing virtualized graphics processing may be performed, at least in part, by components outside of the provider network 100.

FIG. 2A illustrates further aspects of the example system environment for virtualizing graphics processing in a provider network, including selection of an instance type and virtual GPU class for a virtual compute instance with an attached virtual GPU, according to one embodiment. As discussed above, the provider network 100 may offer to the client device 180A a plurality of instance types 121 for virtual compute instances. As shown for purposes of illustration and example, virtual compute instances of type “B” 141B through type “N” 141N may be offered. However, it is contemplated that any suitable number and configuration of virtual compute instance types may be offered to clients by the provider network 100. An instance type may be characterized by its computational resources (e.g., number, type, and configuration of central processing units [CPUs] or CPU cores), memory resources (e.g., capacity, type, and configuration of local memory), storage resources (e.g., capacity, type, and configuration of locally accessible storage), network resources (e.g., characteristics of its network interface and/or network capabilities), and/or other suitable descriptive characteristics. Using the instance type selection functionality 120, the client device 180A may provide an indication, specification, or other selection 201 of a particular instance type. For example, a client may choose or the instance type “B” from a predefined set of instance types using input 201. As another example, a client may specify the desired resources of an instance type using input 201, and the instance type selection functionality 120 may select the instance type “B” based on such a specification. Accordingly, the virtual compute instance type may be selected by the client or on behalf of the client, e.g., using the instance type selection functionality 120.

As discussed above, the provider network 100 may offer to the client device 180A a plurality of virtual GPU classes 122 for virtual GPUs. As shown for purposes of illustration and example, virtual GPUs of class “B” 151B through class “N” 151N may be offered. However, it is contemplated that any suitable number and configuration of virtual GPU classes may be offered to clients by the provider network 100. A virtual GPU class may be characterized by its computational resources for graphics processing, memory resources for graphics processing, and/or other suitable descriptive characteristics. In one embodiment, the virtual GPU classes may represent subdivisions of graphics processing capabilities of a physical GPU, such as a full GPU, a half GPU, a quarter GPU, and so on. Using the instance type selection functionality 120, the client device 180A may provide an indication, specification, or other selection 202 of a particular virtual GPU class. For example, a client may choose the virtual GPU class “B” from a predefined set of virtual GPU classes using input 202. As another example, a client may specify the desired resources of a virtual GPU class using input 202, and the instance type selection functionality 120 may select the virtual GPU class “B” based on such a specification. Accordingly, the virtual GPU class may be selected by the client or on behalf of the client, e.g., using the instance type selection functionality 120.

FIG. 2B illustrates further aspects of the example system environment for virtualizing graphics processing in a provider network, including provisioning of a virtual compute instance with an attached virtual GPU, according to one embodiment. The instance provisioning functionality 130 may provision a virtual compute instance 141B with an attached virtual GPU 151B based on the specified instance type “B” and the specified virtual GPU class “B”. The provisioned virtual compute instance 141B may be implemented by the compute virtualization functionality 140 using suitable physical resources such as a physical compute instance 142B, and the provisioned virtual GPU 151B may be implemented by the GPU virtualization functionality 150 using suitable physical resources such as a physical GPU 152B. As used herein, provisioning a virtual compute instance generally includes reserving resources (e.g., computational and memory resources) of an underlying physical compute instance for the client (e.g., from a pool of available physical compute instances and other resources), installing or launching required software (e.g., an operating system), and making the virtual compute instance available to the client for performing tasks specified by the client. In one embodiment, a virtual GPU of substantially any virtual GPU class may be attached to a virtual compute instance of substantially any instance type. To implement the virtual compute instance 141B with the attached virtual GPU 151B, a physical compute instance 142B may communicate with a physical GPU 152B, e.g., over a network. The physical GPU 152B may be located in a different computing device than the physical compute instance 142B. Even though they may be implemented using separate hardware, the virtual GPU 151B may be said to be attached to the virtual compute instance 141B, or the virtual compute instance may be said to include the virtual GPU. The virtual GPU 151B may be installed on a device that may reside in various locations relative to the physical GPU 152B, e.g., on the same rack, the same switch, the same room, and/or other suitable locations on the same network. A vendor of the physical GPU 152B may be hidden from the client device 180A.

FIG. 3 illustrates the use of a virtual compute instance with a virtual GPU to generate virtual GPU output for display on a client device, according to one embodiment. After the virtual compute instance 141B is provisioned with the attached virtual GPU 151B, the client device 180A may use the provisioned instance and virtual GPU to perform any suitable tasks, e.g., based on input from the client device. The virtual compute instance 141B may execute a particular application 320. The application 320 may be selected or provided by the client. The virtual compute instance 141B may also be configured with a particular operating system 322 that provides support for the application 321. Additionally, the virtual compute instance 141B may be configured with a particular graphics driver 321. The graphics driver 321 may interact with the virtual GPU 151B to provide graphics processing for the application 320, including accelerated two-dimensional graphics processing and/or accelerated three-dimensional graphics processing. In one embodiment, the graphics driver 321 may implement a graphics application programming interface (API) such as Direct3D or OpenGL. The graphics driver 321 may represent components running in user mode and/or kernel mode. Additional components (not shown), such as a graphics runtime, may also be used to provide accelerated graphics processing on the virtual compute instance 141B.

The client device 180A may communicate with the virtual compute instance 141B through a proxy 310. Various other communications may be sent through the proxy 310, including for example virtual GPU output 302 from the virtual GPU 151B to the client device 180A. Use of the proxy 310 may hide the address of the virtual compute instance and any associated resources (including a computing device that implements the virtual GPU 151B) from the client device 180A. The proxy 310 and virtual compute instance 141B may communicate using a suitable remoting protocol. In various embodiments, the proxy 310 may or may not be part of the provider network 100. The client device 180A may provide application input 301 to the application 320 running on the virtual compute instance 141B. For example, the application input 301 may include data to be operated upon by the application 320 and/or instructions to control the execution of the application.

Using the graphics processing provided by the virtual GPU 151B, execution of the application may generate virtual GPU output 302. The virtual GPU output 302 may be provided to the client device 180A, e.g., from the virtual GPU 151B or virtual compute instance 141B. In one embodiment, the virtual GPU output 302 may be sent from the virtual GPU 151B (e.g., from a computing device that includes the virtual GPU) to the client device 180A while bypassing the rest of the virtual compute instance 141B (e.g., the underlying physical compute instance 142B). The virtual GPU output 302 may also be sent to the client device 180A through the proxy 310. The proxy 310 and virtual GPU 151B may communicate using a suitable remoting protocol. In one embodiment, the virtual GPU output 302 may be returned to the virtual compute instance 141B, and the virtual compute instance may send the virtual GPU output to the client device 180A. In one embodiment, the client device 180A may forward the virtual GPU output 302 to another component.

In one embodiment, a display device 181 associated with the client device 180A may present a display 330 of the virtual GPU output 302. In one embodiment, the virtual GPU output 302 may include pixel data, image data, video data, or other graphical data. In one embodiment, the virtual GPU output 302 may drive a full-screen display on the display device 181. Portions of the virtual GPU output 302 may be streamed to the client device 180A over time. In one embodiment, the virtual GPU output 302 may be composited with one or more other sources of graphical data to produce the display 330. In one embodiment, the virtual GPU 151B may be used for general-purpose computing (e.g., GPGPU computing), and the virtual GPU output 302 may not include pixel data or other graphical data. In various embodiments, the client device 180A may process or transform all or part of the virtual GPU output 302 before displaying the output. For example, a CPU, GPU, or co-processor on the client device 180A may transform portions of the virtual GPU output 302 and display the results on the display device 181.

In various embodiments, any suitable technique(s) may be used to offload graphics processing from a virtual compute instance to a physical GPU. In one embodiment, an API shim may intercept calls to a graphics API and marshal the calls over a network to an external computing device that includes a physical GPU. In one embodiment, a driver shim may surface a proprietary driver to the virtual compute instance, intercept calls, and marshal the calls over a network to an external computing device that includes a physical GPU. In one embodiment, a hardware shim may surface a hardware interface to the virtual compute instance and marshal attempts by the instance to interact with the physical GPU.

FIG. 4 illustrates an example hardware architecture for implementing virtualized graphics processing, according to one embodiment. In one embodiment, the virtual compute instance 141B may be implemented using a physical compute instance 142B, and the virtual GPU 151B attached to that instance 141B may be implemented using a separate and distinct computing device termed a graphics server 420. The virtual compute instance 141B may use a virtual interface 400 to interact with an interface device 410. The virtual interface 400 may enable the virtual compute instance 141B to send and receive network data. The interface device 410 may include a network interface and a custom hardware interface. Via the custom hardware interface, the interface device 410 may run program code to emulate a GPU interface and appear to the virtual compute instance 141B to implement or include the virtual GPU 151B. In one embodiment, the interface device 410 may present a graphics API to the virtual compute instance 141B and receive API calls for graphics processing (e.g., accelerated 3D graphics processing). Via the network interface, the interface device 410 may communicate with the graphics server 420 (and thus with the physical GPU 152B) over a network. The interface device 410 may be implemented in any suitable manner, e.g., as an expansion card (such as a PCI Express card) or attached peripheral device for the physical compute instance 142B. The interface device 410 may use single root I/O virtualization to expose hardware virtual functions to the virtual compute instance 141B. In one embodiment, the physical compute instance 142B may implement a plurality of virtual compute instances, each with its own virtual interface, and the virtual compute instances may use the interface device 410 to interact with the corresponding virtual GPUs on one or more graphics servers. The physical compute instance 142B may communicate with the proxy 310 using a suitable remoting protocol, e.g., to send data to and receive data from the client device 180A.

Graphics offload performed by the interface device 410 (e.g., by executing custom program code on the interface device) may translate graphics API commands into network traffic (encapsulating the graphics API commands) that is transmitted to the graphics server 420, and the graphics server 420 may execute the commands on behalf of the interface device. The graphics server 420 may include a network adapter 440 that communicates with the interface device 410 (e.g., with the network interface of the interface device) over a network. In one embodiment, the interface device 410 may receive calls to a graphics API (using the custom hardware interface) and generate graphics offload traffic to be sent to the network adapter 440 (using the network interface). The graphics server 410 may implement a graphics virtual machine 430. Any suitable technologies for virtualization may be used to implement the graphics virtual machine 430. In one embodiment, the graphics virtual machine 430 may represent a generic virtual machine that is GPU-capable and is dedicated to providing accelerated graphics processing using one or more virtual GPUs. The graphics virtual machine 430 may be coupled to the network adapter 440 using a virtual interface 401. The virtual interface 401 may enable the graphics virtual machine 430 to send and receive network data. The graphics virtual machine 430 may implement the virtual GPU 151B using the graphics processing capabilities of the physical GPU 152B. In one embodiment, the physical GPU 152B can be accessed directly by the graphics virtual machine 430, and the physical GPU 152B can use direct memory access to write to and read from memory managed by the graphics virtual machine. In one embodiment, the graphics server 420 may implement a plurality of virtual GPUs (such as virtual GPU 151B) using one or more physical GPUs (such as physical GPU 152B), and the virtual GPUs may interact with the corresponding virtual compute instances on one or more physical compute instances over a network. The graphics server 420 may communicate with the proxy 310 using a suitable remoting protocol, e.g., to send data to and receive data from the client device 180A. For example, the graphics server 420 may generate virtual GPU output based on the commands sent from the interface device 410. The virtual GPU output may be provided to the client device 180A through the proxy 310, e.g., from the physical compute instance 142B or graphics server 420.

FIG. 5 is a flowchart illustrating a method for virtualizing graphics processing in a provider network, according to one embodiment. As shown in 505, a virtual compute instance may be selected. The virtual compute instance may be selected based (at least in part) on computational and memory resources provided by the virtual compute instance. For example, the virtual compute instance may be selected based (at least in part) on a selection of an instance type by a user. As shown in 510, a virtual GPU may be selected. The virtual GPU may be selected based (at least in part) on graphics processing capabilities provided by the virtual GPU. For example, the virtual GPU may be selected based (at least in part) on a selection of a virtual GPU class by a user. The virtual compute instance and virtual GPU may also be selected based (at least in part) on availability of resources in a resource pool of a provider network that manages such resources. In one embodiment, an elastic graphics service may receive the specifications for and/or selections of the virtual compute instance and virtual GPU.

As shown in 515, the selected virtual compute instance may be provisioned with the selected virtual GPU attached. In one embodiment, the elastic graphics service may interact with one or more other services or functionalities of a provider network, such as a compute virtualization functionality and/or GPU virtualization functionality, to provision the instance with the virtual GPU. The virtual compute instance may be implemented using central processing unit (CPU) resources and memory resources of a physical compute instance. The virtual GPU may be implemented using a physical GPU. The physical GPU may be attached to a different computing device than the computing device that provides the CPU resources for the virtual compute instance. The physical GPU may be accessible to the physical compute instance over a network. The virtual GPU may be said to be attached to the virtual compute instance, or the virtual compute instance may be said to include the virtual GPU. In one embodiment, the physical GPU may be shared between the virtual GPU and one or more additional virtual GPUs, and the additional virtual GPUs may be attached to additional virtual compute instances. In one embodiment, the virtual GPU may be accessible to the virtual compute instance via an interface device that includes a network interface and a custom hardware interface. Via the custom hardware interface, the interface device may emulate a GPU and appear to the virtual compute instance to include the virtual GPU. Via the network interface, the interface device may communicate with the physical GPU over the network.

As shown in 520, an application may be executed on the virtual compute instance using the virtual GPU. Execution of the application may include execution of instructions on the virtual compute instance (e.g., on the underlying physical compute instance) and/or virtual GPU (e.g., on the underlying physical GPU). Execution of the application using the virtual GPU may generate virtual GPU output, e.g., output produced by executing instructions or otherwise performing tasks on the virtual GPU. As shown in 525, the virtual GPU output may be provided to a client device. The virtual GPU output may be provided to the client device from the virtual compute instance or virtual GPU. In one embodiment, the virtual GPU output may be displayed on a display device associated with the client device. The virtual GPU output may include pixel information or other graphical data that is displayed on the display device. Execution of the application using the virtual GPU may include graphics processing (e.g., acceleration of three-dimensional graphics processing) for the application using a graphics API.

In some embodiments, scaling techniques may be used with the techniques for virtualized graphics processing described herein. A virtual compute instance may be provisioned, and a first set of one or more GPU(s) may be attached to the instance to provide graphics processing. The first set of one or more virtual GPUs may provide a particular level of graphics processing. After a change in GPU requirements for the instance is determined, the second set of one or more virtual GPU(s) may be selected and attached to the virtual compute instance to replace the graphics processing of the first virtual GPU(s) with a different level of graphics processing. The second virtual GPU(s) may be selected based on the change in GPU requirements. Depending upon the change in GPU requirements, such a scaling operation may migrate graphics processing for a virtual compute instance from a less capable or smaller virtual GPU class to a more capable or larger virtual GPU class or from a more capable or larger virtual GPU class to a less capable or smaller virtual GPU class. In one embodiment, the migration of graphics processing may be performed based (at least in part) on user input representing a change in GPU requirements. In one embodiment, the migration of graphics processing may be performed based (at least in part) on detection of an increase in graphics workload. Live migration may be performed while applications are being executed using the first virtual GPU(s) in a manner that does not require changing or relaunching the applications. Migration of the virtual compute instance to a different physical compute instance may also be performed, e.g., to reduce network latency associated with virtualized graphics processing.

In some embodiments, placement optimization techniques may be used with the techniques for virtualized graphics processing described herein. Optimization of resource placement may improve one or more metrics (e.g., related to resource usage or cost) for GPU virtualization. Physical compute instance(s) may be used to implement virtual compute instance(s), and physical GPU(s) may be used to implement virtual GPU(s) attached to the virtual compute instance(s). Using techniques for placement optimization, locations of the virtual compute instance(s) and/or virtual GPU(s) may be selected in the provider network (from among a set of available physical compute instance(s) and/or physical GPU(s)) based on any suitable placement criteria. The one or more placement criteria may be based (at least in part) on metrics associated with maximizing performance, minimizing cost, minimizing energy usage, and/or any other suitable metrics. The placement criteria may also be associated with network locality. For example, to minimize network latency and/or network usage, a virtual compute instance and attached virtual GPU may be placed in the same rack in the same data center such that network communication between the underlying physical compute instance and physical GPU may not extend beyond a top-of-rack switch or other networking component in the rack. If locations within the same rack are not available, then nearby locations within the same data center may be selected for a virtual compute instance and attached virtual GPU. Placement may be optimized in this manner not only for newly provisioned resources but also for migration of a virtual compute instance and/or attached virtual GPU after their use has begun. When scaling is performed for GPU virtualization as discussed above, the locations of any virtual GPUs may be selected based on placement criteria, and/or the location of the virtual compute instance may be moved based on placement criteria.

In some embodiments, application-specific techniques may be used with the techniques for virtualized graphics processing described herein. A virtual compute instance may be provisioned and may be configured to execute an application. The application may be associated with graphics requirements. For example, an application manifest may specify a recommended graphics processing unit (GPU) class and/or size of video memory for the application, or analysis of execution of the application may determine graphics requirements for the application. A virtual GPU may be selected for the virtual compute instance based (at least in part) on the graphics requirements for the application. The virtual GPU may be selected from a set of virtual GPUs (e.g., belonging to virtual GPU classes) having different capabilities for graphics processing. The virtual GPU may be implemented using a physical GPU that is connected to the virtual compute instance over a network. The application may be executed on the virtual compute instance using the virtual GPU. Additional applications on the virtual compute instance may use different application-specific virtual GPUs, and the application-specific virtual GPUs may vary in graphics processing capabilities based on the varying requirements of the applications.

In some embodiments, local-to-remote migration techniques may be used with the techniques for virtualized graphics processing described herein. A virtual compute instance may be provisioned with a local graphics processing unit (GPU) to provide graphics processing. The local GPU may be implemented using attached hardware or using emulation. Because the local GPU may provide only a low level of graphics processing capability, a virtual GPU may be attached to the virtual compute instance to provide improved graphics processing relative to the local GPU. The virtual GPU may be selected from a set of virtual GPUs (e.g., belonging to virtual GPU classes) having different capabilities for graphics processing. The virtual GPU may be implemented using a physical GPU that is connected to the virtual compute instance over a network. Graphics processing for the virtual compute instance may be migrated from the local GPU to the virtual GPU. In one embodiment, graphics processing for a particular application on the virtual compute instance may be migrated from the local GPU to the virtual GPU during execution of the application. In one embodiment, the migration of graphics processing may be performed based (at least in part) on detection of an increase in graphics workload.

In some embodiments, disaggregated graphics asset delivery techniques may be used with the techniques for virtualized graphics processing described herein. A virtual compute instance may be provisioned, and a virtual graphics processing unit (GPU) may be attached to the instance to provide virtualized graphics processing. The virtual compute instance may be configured to execute an application using the virtualized graphics processing provided by the virtual GPU. To reduce the amount of data transfer between the virtual compute instance and the virtual GPU, graphics assets (e.g., textures, vertex buffers, 3D models, and so on) may be referred to by compact identifiers in the application and in the graphics instructions provided to the virtual GPU by the virtual compute instance. The graphics assets themselves may be obtained by the virtual GPU using the identifiers, e.g., from a graphics asset repository. An asset management service may map the identifiers to the assets and deliver the assets to the virtual GPU. The graphics asset repository may be implemented in a multi-tenant provider network with the virtual compute instance and virtual GPU. In one embodiment, the repository or a portion thereof may be positioned close to one or more virtual GPUs in the provider network in order to minimize network latency. Caching and/or pre-fetching of graphics assets may be used at the virtual GPU for performance optimization. Multiple applications or instances of the same application may refer to the same graphics asset in the repository, e.g., using the same compact identifier. Particular graphics assets may be associated with access restrictions to limit their availability to particular accounts, organizations, users, user groups, or applications, or graphics assets may instead be globally accessible.

In some embodiments, disaggregated graphics asset management techniques may be used with the techniques for virtualized graphics processing described herein. A virtual compute instance may be provisioned, and a virtual graphics processing unit (GPU) may be attached to the instance to provide virtualized graphics processing. The virtual compute instance may be configured to execute an application using the virtualized graphics processing provided by the virtual GPU. To reduce the amount of data transfer between the virtual compute instance and the virtual GPU, graphics assets (e.g., textures, vertex buffers, 3D models, and so on) may be referred to by compact identifiers in the application and in the graphics instructions provided to the virtual GPU by the virtual compute instance. The graphics assets themselves may be obtained by the virtual GPU using the identifiers, e.g., from a graphics asset repository. Developers may manage their assets using an interface to the repository, e.g., as provided by an asset management service. When a developer registers a graphic asset with the asset management service, the asset management service may determine an identifier corresponding to the asset (e.g., representing a handle or secure hash) and store the asset in the repository using an association with the corresponding identifier. Graphics assets may be associated with access restrictions to limit their availability to particular accounts, organizations, users, user groups, or applications, or graphics assets may instead be globally accessible. Different pools of identifiers may be scoped to different sets of users, accounts, organizations, or applications according to the access restrictions. The contents of an identifier pool may be queried by a developer who has appropriate access. Caching and/or pre-fetching of graphics assets may be used at the virtual GPU for performance optimization, and caching and/or pre-fetching policies may be configured by developers for particular assets, identifier pools, applications, and so on.

Computational Task Offloading and Disaggregated Microcode Compilation

FIG. 6 illustrates an example system environment for computational task offloading for virtualized graphics processing, according to one embodiment. As discussed above with respect to FIG. 1 through FIG. 5, a virtual compute instance 141B may be provisioned with an attached virtual GPU 151B. After the virtual compute instance 141B is provisioned with the attached virtual GPU 151B, the client device 180A may use the provisioned instance and virtual GPU to perform any suitable tasks, e.g., based on input from the client device. The virtual compute instance 141B may execute a particular application 320. The application 320 may be selected or provided by the client. The virtual compute instance 141B may also be configured with a particular operating system 322 that provides support for the application 320. Additionally, the virtual compute instance 141B may be configured with a particular graphics driver 321. The graphics driver 321 may interact with the graphics server 420 to provide graphics processing (including accelerated two-dimensional graphics processing and/or accelerated three-dimensional graphics processing) or general-purpose GPU (GPGPU) computing for the application 320. As discussed above, the graphics driver 321 may implement a graphics application programming interface (API) for a standard such as Direct3D, OpenGL, CUDA, or OpenCL. The graphics driver 321 may represent components running in user mode and/or kernel mode. Additional components (not shown), such as a graphics runtime, may also be used to provide accelerated graphics processing and/or GPGPU computing on the virtual compute instance 141B.

A graphics server 420 may include the physical GPU 152B (and potentially other physical GPUs) as well as one or more CPUs and may implement a graphics virtual machine 430 that provides graphics processing using the virtual GPU 151B (and potentially other virtual GPUs). The graphics virtual machine 430 may include a graphics driver 621 that controls (at least in part) the operation of the virtual GPU 151B. In various embodiments, the graphics driver 621 may represent a driver for OpenGL, Direct3D, CUDA, OpenCL, or any other suitable standard (including proprietary technologies) for graphics processing and/or GPU computing. The graphics driver 621 may implement any suitable application programming interfaces (APIs) that permit other components to request that the graphics driver perform certain tasks. In some embodiments, the graphics driver 621 may offer APIs to request that the graphics driver perform tasks using the CPU resources of the local server (potentially in combination with the GPU). For example, the graphics driver 621 may offer one or more APIs for compiling program code such as shader programs into microcode for execution on a GPU. Such tasks performed by the graphics driver using CPU resources and not necessarily GPU resources are referred to herein as computational tasks. Examples of other computational tasks that may be offered by the graphics driver 621 include tessellation (e.g., generation of a triangle mesh) and path rendering (e.g., generation of resolution-independent, vector-based paths for a 2D scene based on pixel input). Such computational tasks may be computationally intensive and may place a burden on the CPU resources of the graphics server 420 if performed using the graphics driver. Using the techniques described herein, computational tasks may be offloaded from the graphics driver 621 to a service 600, referred to herein as a computational offload service, that is external to the graphics server 420 on which the virtual GPU 151B is implemented.

The client device 180A may provide application input to the application 320 running on the virtual compute instance 141B, potentially through a proxy. For example, the application input 601 may include data to be operated upon by the application 620 and/or instructions to control the execution of the application. Using the graphics processing provided by the virtual GPU 151B, execution of the application 320 may generate virtual GPU output. The virtual GPU output may be provided to the client device 180A, e.g., from the virtual GPU 151B or virtual compute instance 141B. In one embodiment, the virtual GPU output may be sent from the virtual GPU 151B (e.g., from the graphics server 420 that includes the virtual GPU) to the client device 180A while bypassing the rest of the virtual compute instance 141B (e.g., the underlying physical compute instance 142B). The virtual GPU output 602 also be sent to the client device 180A through a proxy. In one embodiment, the virtual GPU output may be returned to the virtual compute instance 141B, and the virtual compute instance (e.g., as implemented on the underlying physical compute instance 142B) may send the virtual GPU output to the client device 180A. In one embodiment, the client device 180A may forward the virtual GPU output to another component.

In one embodiment, a display device associated with the client device 180A may present a display of the virtual GPU output. In one embodiment, the virtual GPU output may include pixel data, image data, video data, or other graphical data. In one embodiment, the virtual GPU output may drive a full-screen display on the display device. Portions of the virtual GPU output may be streamed to the client device 180A over time. In one embodiment, the virtual GPU output may be composited with one or more other sources of graphical data to produce the display. In one embodiment, the virtual GPU 151B may be used for general-purpose computing (e.g., GPGPU computing), and the virtual GPU output may not include pixel data or other graphical data. In various embodiments, the client device 180A may process or transform all or part of the virtual GPU output before displaying the output. For example, a CPU, GPU, or co-processor on the client device 180A may transform portions of the virtual GPU output and display the results on the display device.

FIG. 7 illustrates further aspects of the example system environment for computational task offloading for virtualized graphics processing, according to one embodiment. The application 320 may be executed on the virtual compute instance 141B to take advantage of virtualized graphics processing and/or GPGPU computing provided by the virtual GPU 151B. Execution of the application may include sending a request 701 from the virtual compute instance 141B (e.g., from the underlying physical compute instance 142B over a network) to the graphics server 420. The request 701 may explicitly or implicitly ask for execution of one or more tasks using the graphics driver 621 associated with the virtual GPU 151B (e.g., the graphics driver associated with the graphics virtual machine 430 on the graphics server that implements the virtual GPU). As shown in the example of FIG. 7, sending the request 701 may involve a graphics driver 321 of the virtual compute instance 141B as well. If the request 701 is for registration of source code such as a shader program (for graphics processing) or kernel (for GPGPU computing) to be executed on the GPU, the request may include or otherwise indicate the source code of the program as well as a target GPU type for the compilation. If the request 701 is for tessellation, the request may include or otherwise indicate a set of vertices or other 3D graphics assets that are usable as input for the tessellation process. If the request 701 is for path rendering, the request may include or otherwise indicate the input for the requested operation.

The request 701 may be received using the graphics driver 621 on the graphics server 420 and may represent one or more requested tasks. The request 701 may be received using a suitable API. In OpenGL, for example, a glCompileShader command may represent a request to compile a shader (provided as input for the command) into GPU microcode that permits a target GPU to execute the functionality of the shader. Similarly, in Direct3D, a CreateVertexShader or CreatePixelShader command may represent a request to compile a shader (provided as input for the command) into GPU microcode that permits a target GPU to execute the functionality of the shader. Any task associated with the request 701 may be decomposed by the graphics driver 621 into a set of multiple tasks. In one embodiment, one or more of the set of tasks may be offloaded to the service 600 while one or more other tasks of the set of tasks may be implemented using CPU and/or GPU resources of the graphics server 420. In one embodiment, the graphics driver 621 may determine if and/or when to offload one or more tasks based on the request 701 to the service 600. For example, the graphics driver 621 may offload particular types of tasks (e.g., shader or kernel compilation) that tend to be computationally intensive while not offloading other types of tasks. As another example, the graphics driver 621 may schedule the offloading and/or performing of tasks based on current or anticipated resource (e.g., CPU) usage.

A task may be offloaded to a service 600 to which the graphics driver 621 sends a task request 702 to perform the task. The service 600 may generally represent a computational offload service or, in the case of microcode compilation, a microcode compilation service. The service 600 may be implemented using computing resources (e.g., servers) of the same multi-tenant provider network 100 that includes the virtual compute instance 141B and virtual GPU 151B. In one embodiment, the computing resources that perform the service 600 may be located close to the graphics server 420 (e.g., in the same data center or rack) in order to reduce latency between the two components. By offloading computationally intensive tasks from a graphics server 420 that implements the virtual GPU 151B, the graphics server may be optimized for processing using the GPU (e.g., graphics processing and/or GPGPU computing) and not for the offloaded tasks. For example, the graphics server 420 may be configured or selected with less capable and less expensive CPU resources than would otherwise be used to perform the offloaded tasks. Additionally, the graphics driver 621 and the external service 600 may be updated independently of one another.

The requested task may be performed using the service 600, e.g., using one or more servers that implement the service and that are separate and distinct from the graphics server 420. If the request 702 is for microcode compilation, then the service 600 may compile the provided program code of a shader or kernel into microcode that is targeted to a particular GPU type and then return the compiled microcode to the graphics server as the task output 703. The term “microcode” generally refers to GPU-specific program instructions, including binary program code, that a GPU may execute. The microcode may be executed using the virtual GPU 151B in providing graphics processing or GPGPU computing for the virtual compute instance 141B, e.g., by running microcode representing a vertex shader on a per-vertex basis or the microcode representing a pixel shader on a per-pixel basis in rendering a scene. If the request 702 is for tessellation, then the resulting mesh of triangles may be provided to the virtual GPU 151B as the task output 703. If the request 702 is for path rendering, then the resulting vector-based output may be provided to the virtual GPU 151B as the task output 703.

FIG. 8A illustrates further aspects of the example system environment for computational task offloading for virtualized graphics processing, including modification of the computational offload service while maintaining the same graphics driver, according to one embodiment. As discussed above, the graphics driver 621 and the service 600 may be updated independently of one another. As shown in the example of FIG. 8A, the computational offload service 600 has been replaced with a modified version 601. The modified computational offload service 601 may also perform microcode compilation, tessellation, path rendering, or other computational tasks that have been offloaded from the graphics server 420. However, the program code or manner in which the service 601 performs such tasks may be different with respect to the original service, e.g., by performing more efficiently. The modified service 601 may be used with the same version of the graphics driver 621 as discussed above. In this manner, a computational offload service (potentially including a microcode compilation service) may be upgraded without the need to modify any graphics drivers that invoke its functionality.

FIG. 8B illustrates further aspects of the example system environment for computational task offloading for virtualized graphics processing, including modification of the graphics driver while maintaining the same computational offload service, according to one embodiment. As discussed above, the graphics driver 621 and the service 600 may be updated independently of one another. As shown in the example of FIG. 8A, the graphics driver 621 has been replaced with a modified version 622. The modified graphics driver 622 may continue to drive the virtual GPU 151B and also offload microcode compilation, tessellation, path rendering, or other computational tasks from the graphics server 420 to the computational offload service 600. However, the program code or manner in which the modified graphics driver 622 performs such operations may be different with respect to the original graphics driver 621, e.g., by performing more efficiently. The modified driver 622 may be used with the same version of the computational offload service 600 as discussed above. In this manner, a graphics driver may be upgraded without the need to modify a computational offload service (potentially including a microcode compilation service) that performs offloaded tasks.

FIG. 9 illustrates an example system environment for microcode compilation offloading for virtualized graphics processing, according to one embodiment. The application 320 may be executed on the virtual compute instance 141B to take advantage of virtualized graphics processing and/or GPGPU computing provided by the virtual GPU 151B. The application may include program code for one or more shaders or kernels representing functionality to be implemented on the virtual GPU 151B, e.g., to render scenes. Execution of the application 310 may include sending a request 901 to register or perform compilation of program code into GPU-specific microcode from the virtual compute instance 141B (e.g., from the underlying physical compute instance 142B over a network) to the graphics server 420 for execution using the graphics driver 621 associated with the virtual GPU 151B (e.g., the graphics driver associated with the graphics virtual machine 430 on the graphics server that implements the virtual GPU). The request 901 may explicitly or implicitly ask for compilation of source code into microcode using the graphics driver 621 associated with the virtual GPU. As shown in the example of FIG. 9, sending the request 901 may involve a graphics driver 321 of the virtual compute instance 141B as well. The request 901 may include or otherwise indicate the source code of the shader or kernel (e.g., as a string) as well as an indication of a target GPU type for the compilation. The source code may represent high-level program code or an intermediate representation (e.g., a hardware-independent representation) between high-level program code and GPU-specific microcode. Microcode that is executable on GPUs may be compiled specifically for particular GPU types. The target GPU type may represent a vendor, GPU family, and/or GPU model identifier of the virtual GPU that is implemented by the graphics appliance. The target GPU type may represent a GPU type of the virtual GPU.

The request 901 may be received using the graphics driver 621 on the graphics server 420 and may represent one or more requested tasks. The request 901 may be received using a suitable API. In OpenGL, for example, a glCompileShader command may represent a request to compile a shader (provided as input for the command) into GPU microcode that permits a target GPU to execute the functionality of the shader. Similarly, in Direct3D, a CreateVertexShader or CreatePixelShader command may represent a request to compile a shader (provided as input for the command) into GPU microcode that permits a target GPU to execute the functionality of the shader. Any task associated with the request 901 may be decomposed by the graphics driver 621 into a set of multiple tasks. In one embodiment, one or more of the set of tasks may be offloaded to the service 900 while one or more other tasks of the set of tasks may be implemented using CPU and/or GPU resources of the graphics server 420. In one embodiment, the graphics driver 621 may determine if and/or when to offload one or more tasks based on the request 901 to the service 900. For example, the graphics driver 621 may offload particular types of tasks (e.g., shader or kernel compilation) that tend to be computationally intensive while not offloading other types of tasks. As another example, the graphics driver 621 may schedule the offloading and/or performing of tasks based on current or anticipated resource (e.g., CPU) usage.

The requested task may be offloaded to a microcode compilation service 900 to which the graphics driver 621 sends a request 902 to perform the task. The service 900 may be implemented using computing resources (e.g., servers) of the same multi-tenant provider network 100 that includes the virtual compute instance 141B and virtual GPU 151B. In one embodiment, the computing resources that perform the service 900 may be located close to the graphics server 420 (e.g., in the same data center or rack) in order to reduce latency between the two components. By offloading computationally intensive tasks such as microcode compilation from a graphics server 420 that implements the virtual GPU 151B, the graphics server may be optimized for graphics processing and not for the offloaded microcode compilation. Additionally, the graphics driver 621 and the service 900 may be updated independently of one another.

The requested compilation task may be performed using the service 900, e.g., using one or more servers that implement the service and that are separate and distinct from the graphics server 420. The service 600 may compile the provided shader program or kernel program into microcode that is targeted to a particular GPU type and then return the compiled microcode to the graphics server as the task output 603. The microcode may be executed using the virtual GPU 151B in providing graphics processing for the virtual compute instance 141B, e.g., by running the microcode representing a vertex shader on a per-vertex basis or the microcode representing a pixel shader on a per-pixel basis in rendering a scene.

In one embodiment, the microcode compilation service 900 may maintain a microcode cache 950 for storing previously compiled GPU microcode. When a request to compile a shader or kernel into microcode is received by the service 900, it may determine whether suitable compiled microcode is stored in the cache 950. The cache 950 may be implemented using any suitable memory or storage technologies and may be locally accessible or remote relative to the compute instances that implement the microcode compilation service 900. In the cache 950, microcode may be identified by a hash of the program code of the shader or kernel and the target GPU type. When a request 901 to compile program code for a target GPU type is received by the microcode compilation service 900, the service may generate a hash of the program code and target GPU type in the request. The microcode compilation service 900 may then determine whether microcode with the same hash has previously been compiled and stored in the cache 950. Any suitable techniques may be used to keep elements resident in the microcode cache 950, e.g., to keep microcode in the cache that has been most recently requested and/or most frequently requested.

If the requested microcode is available in the cache 950 (e.g., if the cache contains microcode whose hash matches the hash of the requested program code and target GPU type), then that microcode may be retrieved from the cache and provided by the microcode compilation service 900 to the graphics server 420 for execution on the virtual GPU 151B. If the requested microcode is not available in the cache 950 (e.g., if the cache does not contain microcode whose hash matches the hash of the requested program code and target GPU type), then the service 900 may compile the provided program code into microcode that is targeted to a particular GPU type and then return the compiled microcode to the graphics server 420 for execution on the virtual GPU 151B. The microcode may be executed using the virtual GPU 151B in providing graphics processing and/or GPGPU computing for the virtual compute instance, e.g., by running the microcode representing a vertex shader on a per-vertex basis or the microcode representing a pixel shader on a per-pixel basis in rendering a scene.

FIG. 10 is a flowchart illustrating a method for providing computational task offloading for virtualized graphics processing, according to one embodiment. As shown in 1010, a virtual compute instance may be provisioned with an attached virtual GPU. The virtual compute instance may be selected based (at least in part) on computational and memory resources provided by the virtual compute instance. For example, the virtual compute instance may be selected based (at least in part) on a selection of an instance type by a user. The virtual GPU may be selected based (at least in part) on graphics processing and/or GPGPU computing capabilities provided by the virtual GPU. For example, the virtual GPU may be selected based (at least in part) on a selection of a virtual GPU class by a user. The virtual compute instance and virtual GPU may also be selected based (at least in part) on availability of resources in a resource pool of a provider network that manages such resources. In one embodiment, an elastic graphics service may receive the specifications for and/or selections of the virtual compute instance and virtual GPU. The elastic graphics service may interact with one or more other services or functionalities of a provider network, such as a compute virtualization functionality and/or GPU virtualization functionality, to provision the instance with the virtual GPU.

The virtual compute instance may be implemented using central processing unit (CPU) resources and memory resources of a physical compute instance. The virtual GPU may be implemented using a physical GPU. The physical GPU may be attached to a different computing device than the computing device that provides the CPU resources for the virtual compute instance. The physical GPU may be accessible to the physical compute instance over a network. The virtual GPU may be said to be attached to the virtual compute instance, or the virtual compute instance may be said to include the virtual GPU. In one embodiment, the physical GPU may be shared between the virtual GPU and one or more additional virtual GPUs, and the additional virtual GPUs may be attached to additional virtual compute instances. In one embodiment, the virtual GPU may be accessible to the virtual compute instance via an interface device that includes a network interface and a custom hardware interface. Via the custom hardware interface, the interface device may emulate a GPU and appear to the virtual compute instance to include the virtual GPU. Via the network interface, the interface device may communicate with the physical GPU over the network.

A graphics server may include the physical GPU (and potentially other physical GPUs) as well as one or more CPUs and may implement a graphics virtual machine that provides graphics processing using the virtual GPU (and potentially other virtual GPUs). The graphics virtual machine may include a graphics driver that controls (at least in part) the operation of the virtual GPU. In various embodiments, the graphics driver may represent a driver for OpenGL, Direct3D, CUDA, OpenCL, or any other suitable standard (including proprietary technologies) for graphics processing and/or GPGPU computing. The graphics driver may implement any suitable application programming interfaces (APIs) that permit other components to request that the graphics driver perform certain tasks. In some embodiments, the graphics driver may offer APIs to request that the graphics driver perform tasks using the CPU resources of the local server. For example, the graphics driver may offer one or more APIs for compiling shader or kernel programs into microcode for execution on a GPU. Such tasks performed by the graphics driver using CPU resources and not necessarily GPU resources are referred to herein as computational tasks. Examples of other computational tasks that may be offered by graphics drivers include tessellation (e.g., generation of triangles) and path rendering (e.g., generation of resolution-independent, vector-based paths for a 2D scene based on pixel input). Such computational tasks may be computationally intensive and may place a burden on the CPU resources of the graphics server if performed using the graphics driver. Using the techniques described herein, computational tasks may be offloaded from the graphics driver to a service that is external to the graphics server on which the virtual GPU is implemented.

As shown in 1020, an application may be executed on the virtual compute instance to take advantage of virtualized graphics processing and/or GPGPU computing provided by the virtual GPU. Execution of the application may include sending, from the virtual compute instance to the graphics server, a request associated with a computational task for execution using the graphics driver associated with the virtual GPU (e.g., the graphics driver associated with a graphics virtual machine on the graphics server that implements the virtual GPU). The request may explicitly or implicitly request the computational task, potentially along with other tasks. Sending the request may involve a graphics driver on the virtual compute instance as well. If the request is associated with registration or compilation of source code (e.g., a shader program or kernel) into GPU-specific microcode, the request may include or otherwise indicate the source code of the shader as well as a target GPU type for the compilation. If the request is for tessellation, the request may include or otherwise indicate a set of vertices or other 3D graphics assets that are usable as input for the tessellation process. If the request is for path rendering, the request may include or otherwise indicate the input for the requested operation.

The request associated with the computational task may be received using the graphics driver on the graphics server. The request may be received using a suitable API. In OpenGL, for example, a glCompileShader command may represent a request to compile a shader (provided as input for the command) into GPU microcode that permits a target GPU to execute the functionality of the shader. Similarly, in Direct3D, a CreateVertexShader or CreatePixelShader command may represent a request to compile a shader (provided as input for the command) into GPU microcode that permits a target GPU to execute the functionality of the shader. The request may be decomposed by the graphics driver into a set of multiple tasks including the computational task. As shown in 1030, the graphics driver may determine whether to offload the computational task associated with the request. In one embodiment, one or more tasks associated with the request may be offloaded while one or more other tasks associated with the request may be implemented using CPU and/or GPU resources of the graphics server. In one embodiment, the graphics driver may determine if and/or when to offload one or more tasks associated with the request. For example, the graphics driver may offload particular types of tasks (e.g., shader or kernel compilation) that tend to be computationally intensive while not offloading other types of tasks. As another example, the graphics driver may schedule the offloading and/or performing of tasks based on current or anticipated resource (e.g., CPU) usage.

If the task is to be offloaded, then as shown in 1040, the computationaltask may be offloaded to a service to which the graphics driver sends a request to perform the task. The service may generally represent a computational offload service or, in the case of microcode compilation, a microcode compilation service. The service may be implemented using computing resources (e.g., servers) of the same multi-tenant provider network that includes the virtual compute instance and virtual GPU. In one embodiment, the computing resources that perform the service may be located close to the graphics server (e.g., in the same data center or rack) in order to reduce latency between the two components. By offloading computationally intensive tasks from a graphics server that implements the virtual GPU, the graphics server may be optimized for graphics processing and not for the offloaded tasks. Additionally, the graphics driver and the external service may be updated independently of one another.

As shown in 1050, the offloaded task may be performed using the service, e.g., using one or more servers that implement the service and that are separate and distinct from the graphics server. If the request is for microcode compilation, then the service may compile the provided program code of a shader program or kernel into microcode that is targeted to a particular GPU type and then return the compiled microcode to the graphics server. The microcode may be executed using the virtual GPU in providing graphics processing or GPGPU computing for the virtual compute instance, e.g., by running the microcode representing a vertex shader on a per-vertex basis or the microcode representing a pixel shader on a per-pixel basis in rendering a scene. If the request is for tessellation, then the resulting mesh of triangles may be provided to the virtual GPU in providing GPU processing for the virtual compute instance. If the request is for path rendering, then the resulting vector-based output may be provided to the virtual GPU in providing GPU processing for the virtual compute instance.

If the task is not offloaded, then as shown in 1060, the graphics server may perform the task using its CPU and/or GPU. In one embodiment, the virtual GPU may execute graphics instructions using the output of the computational task that was offloaded to the service or performed on the graphics server. Execution of the graphics instructions using the virtual GPU may generate virtual GPU output, e.g., output produced by executing instructions or otherwise performing tasks on the virtual GPU. The virtual GPU output may be provided to a client device. The virtual GPU output may be provided to the client device from the virtual compute instance or virtual GPU. In one embodiment, the virtual GPU output may be displayed on a display device associated with the client device. The virtual GPU output may include pixel information or other graphical data that is displayed on the display device.

FIG. 11 is a flowchart illustrating a method for providing microcode compilation offloading for virtualized graphics processing, according to one embodiment. As shown in 1110, a virtual compute instance may be provisioned with an attached virtual GPU. The virtual compute instance may be selected based (at least in part) on computational and memory resources provided by the virtual compute instance. For example, the virtual compute instance may be selected based (at least in part) on a selection of an instance type by a user. The virtual GPU may be selected based (at least in part) on graphics processing capabilities and/or GPGPU computing capabilities provided by the virtual GPU. For example, the virtual GPU may be selected based (at least in part) on a selection of a virtual GPU class by a user. The virtual compute instance and virtual GPU may also be selected based (at least in part) on availability of resources in a resource pool of a provider network that manages such resources. In one embodiment, an elastic graphics service may receive the specifications for and/or selections of the virtual compute instance and virtual GPU. The elastic graphics service may interact with one or more other services or functionalities of a provider network, such as a compute virtualization functionality and/or GPU virtualization functionality, to provision the instance with the virtual GPU.

The virtual compute instance may be implemented using central processing unit (CPU) resources and memory resources of a physical compute instance. The virtual GPU may be implemented using a physical GPU. The physical GPU may be attached to a different computing device than the computing device that provides the CPU resources for the virtual compute instance. The physical GPU may be accessible to the physical compute instance over a network. The virtual GPU may be said to be attached to the virtual compute instance, or the virtual compute instance may be said to include the virtual GPU. In one embodiment, the physical GPU may be shared between the virtual GPU and one or more additional virtual GPUs, and the additional virtual GPUs may be attached to additional virtual compute instances. In one embodiment, the virtual GPU may be accessible to the virtual compute instance via an interface device that includes a network interface and a custom hardware interface. Via the custom hardware interface, the interface device may emulate a GPU and appear to the virtual compute instance to include the virtual GPU. Via the network interface, the interface device may communicate with the physical GPU over the network.

A graphics server may include the physical GPU (and potentially other physical GPUs) as well as one or more CPUs and may implement a graphics virtual machine that provides graphics processing using the virtual GPU (and potentially other virtual GPUs). The graphics virtual machine may include a graphics driver that controls (at least in part) the operation of the virtual GPU. In various embodiments, the graphics driver may represent a driver for OpenGL, Direct3D, CUDA, OpenCL, or any other suitable standard (including proprietary technologies) for graphics processing and/or GPU computing. The graphics driver may implement any suitable application programming interfaces (APIs) that permit other components to request that the graphics driver perform certain tasks. In some embodiments, the graphics driver may offer APIs to request that the graphics driver perform tasks using the CPU resources of the local server. For example, the graphics driver may offer one or more APIs for compiling program code for shader programs or kernels into microcode for execution on a GPU. Such tasks performed by the graphics driver using CPU resources and not necessarily GPU resources are referred to herein as computational tasks. Such compilation tasks may be computationally intensive and may place a burden on the CPU resources of the graphics server if performed using the graphics driver. Using the techniques described herein, compilation tasks may be offloaded from the graphics driver to a service that is external to the graphics server on which the virtual GPU is implemented.

As shown in 1120, an application may be executed on the virtual compute instance using virtualized graphics processing provided by the virtual GPU. Execution of the application may include sending, from the virtual compute instance to the graphics server, a request associated with compilation of program code into GPU-specific microcode for the virtual GPU. The request may be intended for execution using the graphics driver associated with the virtual GPU (e.g., the graphics driver associated with a graphics virtual machine on the graphics server that implements the virtual GPU). Sending the request may involve a graphics driver on the virtual compute instance as well. The request may include or otherwise indicate the source code of the shader or kernel (e.g., as a string) as well as an indication of a target GPU type for the compilation. Microcode (e.g., GPU-specific program instructions, potentially including binary code) that is executable on GPUs may be compiled specifically for particular GPU types. The target GPU type may represent a vendor, GPU family, and/or GPU model identifier of the virtual GPU that is implemented by the graphics appliance. The target GPU type may represent a GPU type of the virtual GPU.

As shown in 1130, the request associated with the compilation may be received using the graphics driver on the graphics server. The request may be received using a suitable API. In OpenGL, for example, a glCompileShader command may represent a request to compile a shader (provided as input for the command) into GPU microcode that permits a target GPU to execute the functionality of the shader. Similarly, in Direct3D, a CreateVertexShader or CreatePixelShader command may represent a request to compile a shader (provided as input for the command) into GPU microcode that permits a target GPU to execute the functionality of the shader. The request may be decomposed by the graphics driver into a set of multiple tasks including the compilation task, and the graphics driver may determine whether to offload the compilation task associated with the request. The requested task may be offloaded to a microcode compilation service to which the graphics driver sends a request to perform the compilation task. The microcode compilation service may be implemented using computing resources (e.g., servers) of the same multi-tenant provider network that includes the virtual compute instance and virtual GPU. In one embodiment, the computing resources that perform the microcode compilation service may be located close to the graphics server (e.g., in the same data center or rack) in order to reduce latency between the two components. By offloading computationally intensive tasks from a graphics server that implements the virtual GPU, the graphics server may be optimized for graphics processing and not for the offloaded microcode compilation tasks. Additionally, the graphics driver and the microcode compilation service may be updated independently of one another.

As shown in 1140, it may be determined whether suitable compiled microcode is stored in a cache memory managed by the microcode compilation service. The cache memory may be implemented using any suitable memory or storage technologies and may be locally accessible or remote relative to the compute instances that implement the microcode compilation service. In the cache, microcode may be identified by a hash of the shader or kernel program code and the target GPU type. When a request to compile program code for a target GPU type is received by the microcode compilation service, the service may generate a hash of the input program code and target GPU type in the request. The microcode compilation service may then determine whether microcode with the same hash has previously been compiled and stored in the cache. Any suitable techniques may be used to keep elements resident in the microcode cache, e.g., to keep microcode in the cache that has been most recently requested and/or most frequently requested.

As shown in 1150, if the requested microcode is available in the cache (e.g., if the cache contains microcode whose hash matches the hash of the requested program code and target GPU type), then that microcode may be retrieved from the cache and provided by the microcode compilation service to the graphics server for execution on the virtual GPU. As shown in 1160, if the requested microcode is not available in the cache (e.g., if the cache does not contain microcode whose hash matches the hash of the requested program code and target GPU type), then the service may compile the provided program code into microcode that is targeted to a particular GPU type and then return the compiled microcode to the graphics server for execution on the virtual GPU. The microcode compilation may be performed using one or more servers that implement the microcode compilation service and that are separate and distinct from the graphics server. The microcode may be executed using the virtual GPU in providing graphics processing or GPGPU computing for the virtual compute instance, e.g., by running microcode representing a vertex shader on a per-vertex basis or the microcode representing a pixel shader on a per-pixel basis in rendering a scene.

In one embodiment, the virtual GPU may execute graphics instructions using the output of the microcode compilation task that was offloaded to the service. Execution of the graphics instructions using the virtual GPU may generate virtual GPU output, e.g., output produced by executing instructions or otherwise performing tasks on the virtual GPU. The virtual GPU output may be provided to a client device. The virtual GPU output may be provided to the client device from the virtual compute instance or virtual GPU. In one embodiment, the virtual GPU output may be displayed on a display device associated with the client device. The virtual GPU output may include pixel information or other graphical data that is displayed on the display device.

Illustrative Computer System

In at least some embodiments, a computer system that implements a portion or all of one or more of the technologies described herein may include a computer system that includes or is configured to access one or more computer-readable media. FIG. 12 illustrates such a computing device 3000. In the illustrated embodiment, computing device 3000 includes one or more processors 3010 coupled to a system memory 3020 via an input/output (I/O) interface 3030. Computing device 3000 further includes a network interface 3040 coupled to I/O interface 3030.

In various embodiments, computing device 3000 may be a uniprocessor system including one processor 3010 or a multiprocessor system including several processors 3010 (e.g., two, four, eight, or another suitable number). Processors 3010 may include any suitable processors capable of executing instructions. For example, in various embodiments, processors 3010 may be processors implementing any of a variety of instruction set architectures (ISAs), such as the x86, PowerPC, SPARC, or MIPS ISAs, or any other suitable ISA. In multiprocessor systems, each of processors 3010 may commonly, but not necessarily, implement the same ISA.

System memory 3020 may be configured to store program instructions and data accessible by processor(s) 3010. In various embodiments, system memory 3020 may be implemented using any suitable memory technology, such as static random access memory (SRAM), synchronous dynamic RAM (SDRAM), nonvolatile/Flash-type memory, or any other type of memory. In the illustrated embodiment, program instructions and data implementing one or more desired functions, such as those methods, techniques, and data described above, are shown stored within system memory 3020 as code (i.e., program instructions) 3025 and data 3026.

In one embodiment, I/O interface 3030 may be configured to coordinate I/O traffic between processor 3010, system memory 3020, and any peripheral devices in the device, including network interface 3040 or other peripheral interfaces. In some embodiments, I/O interface 3030 may perform any necessary protocol, timing or other data transformations to convert data signals from one component (e.g., system memory 3020) into a format suitable for use by another component (e.g., processor 3010). In some embodiments, I/O interface 3030 may include support for devices attached through various types of peripheral buses, such as a variant of the Peripheral Component Interconnect (PCI) bus standard or the Universal Serial Bus (USB) standard, for example. In some embodiments, the function of I/O interface 3030 may be split into two or more separate components, such as a north bridge and a south bridge, for example. Also, in some embodiments some or all of the functionality of I/O interface 3030, such as an interface to system memory 3020, may be incorporated directly into processor 3010.

Network interface 3040 may be configured to allow data to be exchanged between computing device 3000 and other devices 3060 attached to a network or networks 3050. In various embodiments, network interface 3040 may support communication via any suitable wired or wireless general data networks, such as types of Ethernet network, for example. Additionally, network interface 3040 may support communication via telecommunications/telephony networks such as analog voice networks or digital fiber communications networks, via storage area networks such as Fibre Channel SANs, or via any other suitable type of network and/or protocol.

In some embodiments, system memory 3020 may be one embodiment of a computer-readable (i.e., computer-accessible) medium configured to store program instructions and data as described above for implementing embodiments of the corresponding methods and apparatus. However, in other embodiments, program instructions and/or data may be received, sent or stored upon different types of computer-readable media. Generally speaking, a computer-readable medium may include non-transitory storage media or memory media such as magnetic or optical media, e.g., disk or DVD/CD coupled to computing device 3000 via I/O interface 3030. A non-transitory computer-readable storage medium may also include any volatile or non-volatile media such as RAM (e.g. SDRAM, DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc., that may be included in some embodiments of computing device 3000 as system memory 3020 or another type of memory. Further, a computer-readable medium may include transmission media or signals such as electrical, electromagnetic, or digital signals, conveyed via a communication medium such as a network and/or a wireless link, such as may be implemented via network interface 3040. Portions or all of multiple computing devices such as that illustrated in FIG. 12 may be used to implement the described functionality in various embodiments; for example, software components running on a variety of different devices and servers may collaborate to provide the functionality. In some embodiments, portions of the described functionality may be implemented using storage devices, network devices, or various types of computer systems. The term “computing device,” as used herein, refers to at least all these types of devices, and is not limited to these types of devices.

The various methods as illustrated in the Figures and described herein represent examples of embodiments of methods. The methods may be implemented in software, hardware, or a combination thereof. In various ones of the methods, the order of the steps may be changed, and various elements may be added, reordered, combined, omitted, modified, etc. Various ones of the steps may be performed automatically (e.g., without being directly prompted by user input) and/or programmatically (e.g., according to program instructions).

The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the description of the invention and the appended claims, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term “and/or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It will be further understood that the terms “includes,” “including,” “comprises,” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

As used herein, the term “if” may be construed to mean “when” or “upon” or “in response to determining” or “in response to detecting,” depending on the context. Similarly, the phrase “if it is determined” or “if [a stated condition or event] is detected” may be construed to mean “upon determining” or “in response to determining” or “upon detecting [the stated condition or event]” or “in response to detecting [the stated condition or event],” depending on the context.

It will also be understood that, although the terms first, second, etc., may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first contact could be termed a second contact, and, similarly, a second contact could be termed a first contact, without departing from the scope of the present invention. The first contact and the second contact are both contacts, but they are not the same contact.

Numerous specific details are set forth herein to provide a thorough understanding of claimed subject matter. However, it will be understood by those skilled in the art that claimed subject matter may be practiced without these specific details. In other instances, methods, apparatus, or systems that would be known by one of ordinary skill have not been described in detail so as not to obscure claimed subject matter. Various modifications and changes may be made as would be obvious to a person skilled in the art having the benefit of this disclosure. It is intended to embrace all such modifications and changes and, accordingly, the above description is to be regarded in an illustrative rather than a restrictive sense. 

What is claimed is:
 1. A system, comprising: a virtual compute instance, wherein the virtual compute instance is implemented using central processing unit (CPU) resources and memory resources of a physical compute instance, wherein the virtual compute instance is provided by a multi-tenant provider network; a virtual graphics processing unit (GPU) attached to the virtual compute instance over a network, wherein the virtual GPU is implemented using a physical GPU, wherein the virtual GPU is provided by the multi-tenant provider network; and one or more computing devices configured to implement a microcode compilation service, wherein the microcode compilation service is configured to: receive, from a graphics driver associated with the virtual GPU, a request to compile program code for a target GPU type associated with the virtual GPU, wherein the graphics driver associated with the virtual GPU is external to the microcode compilation service; compile the program code into microcode, wherein the microcode is executable on the target GPU type; and send the microcode to the graphics driver; and wherein the virtual GPU is configured to execute the microcode in providing GPU processing for the virtual compute instance.
 2. The system as recited in claim 1, wherein the microcode compilation service is further configured to: store the microcode in a cache memory associated with the microcode compilation service; receive an additional request to compile the program code for the target GPU type; and retrieve the microcode from the cache memory based at least in part on the request.
 3. The system as recited in claim 1, wherein the microcode compilation service is further configured to: replace the microcode compilation service with a modified microcode compilation service; and compile additional program code into additional microcode, wherein the additional program code is compiled into the additional microcode based at least in part on an additional request from the graphics driver, wherein the additional microcode is executable on the target GPU type associated with the virtual GPU, and wherein the additional program code is compiled into the additional microcode using the modified microcode compilation service.
 4. The system as recited in claim 1, wherein the microcode compilation service is further configured to: replace the graphics driver with a modified graphics driver; and compile additional program code into additional microcode, wherein the additional program code is compiled into the additional microcode based at least in part on an additional request from the modified graphics driver, wherein the additional microcode is executable on the target GPU type associated with the virtual GPU, and wherein the additional program code is compiled into the additional microcode using the microcode compilation service.
 5. A computer-implemented method, comprising: provisioning, in a multi-tenant provider network, a virtual compute instance and a virtual graphics processing unit (GPU) attached to the virtual compute instance over a network, wherein the virtual compute instance is implemented using a physical compute instance, and wherein the virtual GPU is implemented using a physical GPU; compiling program code into microcode, wherein the microcode is executable on a target GPU type associated with the virtual GPU, and wherein the program code is compiled into the microcode responsive to a request received from a graphics driver associated with the virtual GPU using a service external to the graphics driver; sending the microcode to the graphics driver; and executing the microcode on the virtual GPU.
 6. The method as recited in claim 5, wherein the program code is compiled into the microcode based at least in part on a request from the graphics driver, and wherein the method further comprises: storing the microcode in a cache memory associated with the service; receiving an additional request to compile the program code for the target GPU type; and retrieving the microcode from the cache memory based at least in part on the request.
 7. The method as recited in claim 6, wherein the microcode is identified in the cache memory using a hash of the program code and the target GPU type.
 8. The method as recited in claim 5, wherein the program code is compiled into the microcode based at least in part on a request from the graphics driver, and wherein the method further comprises: replacing the service with a modified service; and compiling additional program code into additional microcode, wherein the additional program code is compiled into the additional microcode based at least in part on an additional request from the graphics driver, wherein the additional microcode is executable on the target GPU type associated with the virtual GPU, and wherein the additional program code is compiled into the additional microcode using the modified service.
 9. The method as recited in claim 5, wherein the program code is compiled into the microcode based at least in part on a request from the graphics driver, and wherein the method further comprises: replacing the graphics driver with a modified graphics driver; and compiling additional program code into additional microcode, wherein the additional program code is compiled into the additional microcode based at least in part on an additional request from the modified graphics driver, wherein the additional microcode is executable on the target GPU type associated with the virtual GPU, and wherein the additional program code is compiled into the additional microcode using the service.
 10. The method as recited in claim 5, further comprising: initiating execution of an application using the virtual compute instance, wherein the application is associated with the program code; sending, from the virtual compute instance to the graphics driver using an application programming interface (API) of the graphics driver, a request associated with compilation of the program code into the microcode; and sending, from the graphics driver to the service, a request to compile the program code into the microcode using the service.
 11. The method as recited in claim 5, wherein the virtual GPU is implemented using a graphics server that includes the physical GPU, and wherein the graphics server is optimized to perform GPU processing and not to perform microcode compilation.
 12. The method as recited in claim 5, wherein the service is implemented using one or more computational resources of the multi-tenant provider network.
 13. A non-transitory computer-readable storage medium storing program instructions computer-executable to perform: receiving, at a graphics driver from an application, a request to perform a graphics function offered by the graphics driver, wherein a computational task is associated with the graphics function, wherein the request is received using an application programming interface (API) of the graphics driver, wherein the graphics driver is associated with a virtual graphics processing unit (GPU) implemented using a physical GPU of a graphics server, wherein the application is executed on a virtual compute instance implemented using a physical compute instance, and wherein the virtual GPU is attached to the virtual compute instance over a network; sending, over the network from the graphics driver to a service external to the graphics driver, a request to perform the computational task using the service, wherein the service is implemented on a server different from the graphics server and the physical compute instance; receiving, at the graphics driver, a result of the computational task performed by the service external to the graphics driver; and using, by the graphics driver, the result of the computational task to perform the graphics function via the virtual GPU.
 14. The non-transitory computer-readable storage medium as recited in claim 13, wherein the computational task comprises tessellation.
 15. The non-transitory computer-readable storage medium as recited in claim 13, wherein the computational task comprises rasterizing path rendering.
 16. The non-transitory computer-readable storage medium as recited in claim 13, wherein the computational task comprises compiling a shader program into microcode, wherein the microcode is executable on a target GPU type associated with the virtual GPU, and wherein the program instructions are further computer-executable to perform: executing the microcode on the virtual GPU in providing graphics processing to the virtual compute instance.
 17. The non-transitory computer-readable storage medium as recited in claim 16, wherein the program instructions are further computer-executable to perform: receiving, at the graphics driver from the application, an additional request to compile the shader program for the target GPU type; and receiving, at the graphics driver from the service, the microcode from a cache memory associated with the service.
 18. The non-transitory computer-readable storage medium as recited in claim 17, wherein the microcode is identified in the cache memory using a hash of the shader program and the target GPU type.
 19. The non-transitory computer-readable storage medium as recited in claim 13, wherein the program instructions are further computer-executable to perform: sending, from the graphics driver to a modified service, an additional request to perform an additional computational task using the modified service; and receiving, at the graphics driver, a result of the additional computational task performed by the modified service.
 20. The non-transitory computer-readable storage medium as recited in claim 13, wherein the program instructions are further computer-executable to perform: replacing the graphics driver with a modified graphics driver; sending, from the modified graphics driver to the service, an additional request to perform an additional computational task using the service; and receiving, at the modified graphics driver, a result of the additional computational task performed by the service. 